import { PluginDefinition } from 'yam-types'
import * as schema from './schema.json'
import configOperator from './handlers/config'
import secretOperator from './handlers/secret'
import { ApplicationSecret, Configuration } from './types'
import { name, version } from './package.json'

export default {
  name,
  schema,
  version,
  handlers: {
    'config[?(@.type=="configMap")]': configOperator,
    'config[?(@.type=="secret")]': secretOperator,
  }
} as PluginDefinition<Configuration | ApplicationSecret>